USE $(database)
GO

/****** Object:  Table [dbo].[characterBlueprints]    Script Date: 12/07/2011 17:32:23 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[characterBlueprints](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[blueprintID] [int] NOT NULL,
	[blueprintName] [varchar](50) NOT NULL,
	[quantity] [int] NOT NULL,
	[characterID] [bigint] NOT NULL,
 CONSTRAINT [PK_characterBlueprints] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[characterBlueprints]  WITH CHECK ADD  CONSTRAINT [FK_characterBlueprints_account_characters] FOREIGN KEY([characterID])
REFERENCES [dbo].[account_characters] ([id])
GO

ALTER TABLE [dbo].[characterBlueprints] CHECK CONSTRAINT [FK_characterBlueprints_account_characters]
GO

ALTER TABLE [dbo].[characterBlueprints]  WITH CHECK ADD  CONSTRAINT [FK_characterBlueprints_invTypes] FOREIGN KEY([blueprintID])
REFERENCES [dbo].[invTypes] ([typeID])
GO

ALTER TABLE [dbo].[characterBlueprints] CHECK CONSTRAINT [FK_characterBlueprints_invTypes]
GO

ALTER TABLE [dbo].[characterBlueprints] ADD  CONSTRAINT [DF_characterBlueprints_quantity]  DEFAULT ((0)) FOR [quantity]
GO

